package cn.edu.thu.laud.lasql.function.iface;

import java.nio.ByteBuffer;
import java.util.List;
/**
 * every local function should implement this interface .
 * @author hxd
 *
 */
public interface LaSQLLocalFunction {
	/**
	 * 
	 * @param params a list of parameters. the order of parameters is constructed like this:
	 * if user write a function in lasql:Function('function_name','param1','param2','param3'..)
	 * <br>then the parames is constructed : params.add("param1"); params.add("param2"); params.add("param3")...
	 * @return even though we return a ByteBuffer type,this value type is limited by our database' column type.so function answer only support :String(ascii or utf8),Boolean,ByteBuffer,java.util.Date,
	 * java.math.BigDecimal,Double,Float,Integer,java.util.UUID,Long. so the returned result  should can be decompose from these type to ByteBuffer and return this bytebuffer.
	 * <br><h3>use LaSQLFunctionUtil.decompose() to get the bytebuffer.<h3>
	 */
	public ByteBuffer executeLocal(List<String> params) throws Exception;
	
	
}
